<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>denorm</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="deltapxw.html" title="deltapxw" />
    <link rel="next" href="diff.html" title="diff" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">denorm</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="deltapxw.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="diff.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="denorm"></a>
      <div class="titlepage"></div>
      <a id="IndexDenorm" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">denorm</span>
        </h2>
        <p>denorm — 
      Mixes low level noise to a list of a-rate signals
          </p>
      </div>
      <div class="refsect1">
        <a id="idp99049568"></a>
        <h2>Description</h2>
        <p>
    	Mixes low level (~1e-20 for floats, and ~1e-56 for doubles)
    	noise to a list of a-rate signals. Can be used before IIR
    	filters and reverbs to avoid denormalized numbers which may
    	otherwise result in significantly increased CPU usage.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp99051296"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>denorm</strong></span> a1[, a2[, a3[, ... ]]]</pre>
      </div>
      <div class="refsect1">
        <a id="idp99053696"></a>
        <h2>Performance</h2>
        <p>
    <span class="emphasis"><em>a1[, a2[, a3[, ... ]]]</em></span> -- signals to mix noise with

    </p>
        <p>
      Some processor architectures (particularly Pentium IVs) are very slow at processing extremely small numbers. These small numbers can appear as a result of some decaying feedback process like reverb and IIR filters. Low level noise can be added so that very small numbers are never reached, and they are 'absorbed' by this 'noise floor'.
    </p>
        <p>
      If CPU usage goes to 100% at the end of reverb tails, or you get audio glitches in processes that shouldn't use too much CPU, using <span class="emphasis"><em>denorm</em></span> before the culprit opcode or process might solve the problem.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp99057616"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the denorm opcode. It uses the file <a class="ulink" href="examples/denorm.csd" target="_top"><em class="citetitle">denorm.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp99059472"></a>
          <p class="title">
            <strong>Example 192. Example of the denorm opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;RT audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o denorm.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="comment">; slightly simplified example from Istvan Varga 2006</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span> <span class="op">=</span> 1

garvb <span class="opc">init</span> 0

<span class="oblock">instr</span> 1

a1  <span class="opc">oscils</span> 0.6, 440, 0
a2  <span class="opc">linsegr</span> 0, 0.005, 1, 3600, 1, 0.08, 0
a1  <span class="op">=</span>  a1 <span class="op">*</span> a2
    <span class="opc">vincr</span> garvb, a1
    <span class="opc">outs</span> a1, a1
<span class="oblock">endin</span>

<span class="oblock">instr</span> 99	<span class="comment">;"Always on"</span>

       <span class="opc">denorm</span> garvb
aL, aR <span class="opc">reverbsc</span> garvb <span class="op">*</span> 0.5, garvb <span class="op">*</span> 0.5, 0.92, 10000
       <span class="opc">clear</span> garvb
       <span class="opc">outs</span> aL, aR
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> 99 0 -1	<span class="comment">;held by a negative p3, means "always on" </span>
<span class="stamnt">i</span> 1 0 0.5
<span class="stamnt">i</span> 1 4 0.5
<span class="stamnt">e</span> 8		<span class="comment">;8 extra seconds after the performance</span>

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp99063760"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Istvan Varga</td>
          </tr>
          <tr>
            <td>2005</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="deltapxw.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="diff.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">deltapxw </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> diff</td>
        </tr>
      </table>
    </div>
  </body>
</html>
